#import "BaseModel.h"

@implementation BaseModel

-(void)get_json:(NSString *)url
{
    [ASIHTTPRequest setDefaultUserAgentString:@"GEE IPHONE IOS4 1.0"];
    [ASIHTTPRequest setDefaultTimeOutSeconds:2];
    
    NSURL *post_url = [NSURL URLWithString:url];
    
    __block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:post_url];
    [request setCompletionBlock:^{
        // Use when fetching text data
        NSString *responseString = [request responseString];
        
        // Use when fetching binary data
        //NSData *responseData = [request responseData];
        
        //NSLog(@"%@",responseData);
        //NSLog(@"%@",responseString);
        NSLog(@"%@",[responseString objectFromJSONString]);

        
    }];
    [request setFailedBlock:^{
        NSError *error = [request error];
        NSLog(@"error data %@",error); 
    }];
    
    
    [request startSynchronous];
}


@end
